home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / network / atre12.zip / LF.ZIP / SYNAN.C < prev    next >
C/C++ Source or Header  |  1991-07-05  |  39KB  |  1,350 lines

  1.  
  2. /*  A Bison parser, made from synan.y  */
  3.  
  4. #define FUNCTION        3
  5. #define DOMAIN  4
  6. #define DIMENSIONS      5
  7. #define EQUALS  6
  8. #define INTEGER 7
  9. #define QUANTIZATION    8
  10. #define COLON   9
  11. #define TRAINING        10
  12. #define SET     11
  13. #define SIZE    12
  14. #define TEST    13
  15. #define CODING  14
  16. #define LARGEST 15
  17. #define SMALLEST        16
  18. #define REAL    17
  19. #define TREE    18
  20. #define MIN     19
  21. #define MAX     20
  22. #define CORRECT 21
  23. #define EPOCHS  22
  24. #define VOTE    23
  25. #define IDENTIFIER      24
  26.  
  27. #line 1 "synan.y"
  28.  
  29.  
  30. /*****************************************************************************
  31.  ****                                                                     ****
  32.  **** synan.y                                                             ****
  33.  ****                                                                     ****
  34.  **** Copyright (C) A. Dwelly and W.W. Armstrong, 1990.                   ****
  35.  ****                                                                     ****
  36.  **** All rights reserved.                                                ****
  37.  ****                                                                     ****
  38.  **** This is the syntax analyser for the small language `lf` that learns ****
  39.  **** a function using the atree package. Atree is an adaptive            ****
  40.  **** logic network package based on work done by Prof. W. W. Armstrong   ****
  41.  **** and others in the Department of Computing Science, University of    ****
  42.  **** Alberta, and previous work at the Universite de Montreal, and at    ****
  43.  **** AT&T Bell Laboratories, Holmdel, N. J.  The software demonstrates   ****
  44.  **** that networks consisting of many layers of linear threshold         ****
  45.  **** elements can indeed be effectively trained.                         ****
  46.  ****                                                                     ****
  47.  **** License:                                                            ****
  48.  **** A royalty-free license is granted for the use of this software for  ****
  49.  **** NON-COMMERCIAL PURPOSES ONLY. The software may be copied and        ****
  50.  **** modified provided this notice appears in its entirety and unchanged ****
  51.  **** in all copies, whether changed or not.  Persons modifying the code  ****
  52.  **** are requested to state the date, the changes made and who made them ****
  53.  **** in the modification history.                                        ****
  54.  ****                                                                     ****
  55.  **** Warranty:                                                           ****
  56.  **** No warranty of any kind is provided with this software.             ****
  57.  **** This software is not supported.  Neither the authors, nor the       ****
  58.  **** University of Alberta, its officers, agents, servants or employees  ****
  59.  **** shall be liable or responsible in any way for any damage to         ****
  60.  **** property or direct personal or consequential injury of any nature   ****
  61.  **** whatsoever that may be suffered or sustained by any licensee, user  ****
  62.  **** or any other party as a consequence of the use or disposition of    ****
  63.  **** this software.                                                      ****
  64.  ****                                                                     ****
  65.  **** Patent:                                                             ****
  66.  **** The use of a digital circuit which transmits a signal indicating    ****
  67.  **** heuristic responsibility is protected by U. S. Patent 3,934,231     ****
  68.  **** and others assigned to Dendronic Decisions Limited of Edmonton,     ****
  69.  **** W. W. Armstrong, President.                                         ****
  70.  ****                                                                     ****
  71.  **** A royalty-free license is granted for the use of this patent to     ****
  72.  **** run this software for NON-COMMERCIAL PURPOSES ONLY and the          ****
  73.  **** extension of this patent license to modified versions of this       ****
  74.  **** software is granted provided the purpose is NON-COMMERCIAL ONLY.    ****
  75.  ****                                                                     ****
  76.  **** Modification history:                                               ****
  77.  ****                                                                     ****
  78.  **** 09.02.90 Initial implementation, A.Dwelly                           ****
  79.  **** 91.04.15 Port to PC and minor bug fixes, R. Manderscheid            ****
  80.  **** 91.05.20 Port to Windows, M. Thomas                                 ****
  81.  ****                                                                     ****
  82.  *****************************************************************************/
  83. #include <stdio.h>
  84. #include <stdlib.h>
  85. #include <ctype.h>
  86. #include <windows.h>
  87. #include "atree.h"
  88. #include "lf.h"
  89.  
  90. /* front end for MessageBox */
  91. #define Printf(str,fmt) { \
  92.                         char szBuff[80]; \
  93.                         wsprintf(szBuff, str, fmt); \
  94.                         MessageBox(NULL, szBuff, "LF Error", MB_OK | \
  95.                             MB_ICONSTOP); \
  96.                         }
  97.  
  98. int line_no;
  99. int in_int;
  100. float in_real;
  101. int tuple_ptr;
  102. int table_ptr;
  103. int tmp_max_sz;
  104. int table_size;
  105. float **tmp_table;
  106. bool train_size_flag;
  107. bool test_size_flag;
  108. bool largest_flag;
  109. bool smallest_flag;
  110. extern prog_type prog;
  111.  
  112. #ifndef YYLTYPE
  113. typedef
  114.   struct yyltype
  115.     {
  116.       int timestamp;
  117.       int first_line;
  118.       int first_column;
  119.       int last_line;
  120.       int last_column;
  121.       char *text;
  122.    }
  123.   yyltype;
  124.  
  125. #define YYLTYPE yyltype
  126. #endif
  127.  
  128. #ifndef YYSTYPE
  129. #define YYSTYPE int
  130. #endif
  131. #include <stdio.h>
  132.  
  133. #ifndef __STDC__
  134. #define const
  135. #endif
  136.  
  137.  
  138.  
  139. #define YYFINAL         96
  140. #define YYFLAG          -32768
  141. #define YYNTBASE        25
  142.  
  143. #define YYTRANSLATE(x) (x)
  144.  
  145. static const short yyrline[] = {     0,
  146.    100,   101,   104,   106,   155,   156,   158,   159,   160,   161,
  147.    162,   163,   164,   165,   168,   173,   187,   192,   199,   204,
  148.    218,   222,   227,   231,   237,   244,   266,   280,   287,   313,
  149.    328,   343,   360,   361,   367,   373,   387,   392,   399,   405,
  150.    419,   424,   430,   432,   433,   435,   436,   437,   438,   441,
  151.    447,   453,   459
  152. };
  153.  
  154. static const char * const yytname[] = {     0,
  155. "error","$illegal.","FUNCTION","DOMAIN","DIMENSIONS","EQUALS","INTEGER","QUANTIZATION","COLON","TRAINING",
  156. "SET","SIZE","TEST","CODING","LARGEST","SMALLEST","REAL","TREE","MIN","MAX",
  157. "CORRECT","EPOCHS","VOTE","IDENTIFIER","program"
  158. };
  159.  
  160. static const short yyr1[] = {     0,
  161.     25,    25,    26,    27,    28,    28,    29,    29,    29,    29,
  162.     29,    29,    29,    29,    31,    30,    32,    32,    34,    33,
  163.     36,    35,    37,    35,    38,    40,    39,    41,    43,    42,
  164.     44,    44,    45,    45,    47,    46,    48,    48,    50,    49,
  165.     51,    51,    52,    53,    53,    54,    54,    54,    54,    55,
  166.     56,    57,    58
  167. };
  168.  
  169. static const short yyr2[] = {     0,
  170.      2,     2,     3,     4,     1,     2,     1,     1,     1,     1,
  171.      1,     1,     1,     1,     0,     4,     1,     2,     0,     4,
  172.      0,     4,     0,     5,     5,     0,     5,     5,     0,     5,
  173.      1,     2,     1,     1,     0,     4,     1,     2,     0,     4,
  174.      1,     2,     2,     1,     2,     1,     1,     1,     1,     3,
  175.      4,     4,     3
  176. };
  177.  
  178. static const short yydefact[] = {     0,
  179.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  180.     43,    44,    46,    47,    48,    49,     1,     2,     0,     0,
  181.      0,     0,     0,     0,     0,     3,     5,     7,     8,     9,
  182.     10,    11,    12,    13,    14,     0,     0,     0,     0,    45,
  183.      0,    15,     0,     0,    19,    35,    39,     6,    50,     0,
  184.      0,    53,     4,     0,    26,     0,    29,     0,     0,     0,
  185.      0,    51,    52,    17,    16,     0,     0,     0,     0,    21,
  186.     20,    34,    33,    37,    36,    41,    40,    18,    27,    31,
  187.     25,    30,    28,     0,    23,    38,    42,    32,     0,     0,
  188.     22,     0,    24,     0,     0,     0
  189. };
  190.  
  191. static const short yydefgoto[] = {    94,
  192.      3,     6,    26,    27,    28,    54,    65,    29,    59,    71,
  193.     84,    90,    30,    31,    66,    32,    33,    68,    79,    80,
  194.     34,    60,    75,    35,    61,    77,     4,    11,    12,    13,
  195.     14,    15,    16
  196. };
  197.  
  198. static const short yypact[] = {     0,
  199.      2,   -10,   -11,     5,     7,    13,    10,     4,    -2,    25,
  200.    -10,-32768,-32768,-32768,-32768,-32768,-32768,-32768,    26,    27,
  201.     23,    24,    30,    31,    32,    13,-32768,-32768,-32768,-32768,
  202. -32768,-32768,-32768,-32768,-32768,    33,    35,    36,    37,-32768,
  203.     38,-32768,    -1,    18,-32768,-32768,-32768,-32768,-32768,    39,
  204.     40,-32768,-32768,    41,-32768,    43,-32768,    44,    45,    -3,
  205.     -3,-32768,-32768,-32768,    46,    -3,    47,    -3,    48,-32768,
  206.     49,-32768,-32768,-32768,    -3,-32768,    -3,-32768,    -3,-32768,
  207. -32768,    -3,-32768,    34,-32768,-32768,-32768,-32768,    50,    42,
  208. -32768,    51,-32768,    59,    60,-32768
  209. };
  210.  
  211. static const short yypgoto[] = {-32768,
  212.     57,-32768,-32768,    52,-32768,-32768,-32768,-32768,-32768,-32768,
  213. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   -29,   -60,
  214. -32768,-32768,-32768,-32768,-32768,-32768,    61,-32768,    54,-32768,
  215. -32768,-32768,-32768
  216. };
  217.  
  218.  
  219. #define YYLAST          78
  220.  
  221.  
  222. static const short yytable[] = {    74,
  223.     76,     7,     1,    72,    55,     5,     2,     1,     8,     9,
  224.     56,    19,    10,    73,    86,    36,    87,     2,    88,    38,
  225.     20,    88,    21,    57,    37,    22,    23,    24,    25,    58,
  226.     39,    41,    42,    43,    44,    45,    46,    47,    82,    49,
  227.     50,    51,    89,    52,    53,    62,    63,    64,    67,    69,
  228.     92,    70,    78,    81,    83,    85,    91,    93,    95,    96,
  229.     18,     0,     0,    17,    40,     0,     0,     0,     0,     0,
  230.      0,     0,     0,     0,     0,     0,     0,    48
  231. };
  232.  
  233. static const short yycheck[] = {    60,
  234.     61,    12,     3,     7,     6,     4,    18,     3,    19,    20,
  235.     12,     5,    23,    17,    75,     6,    77,    18,    79,    22,
  236.      8,    82,    10,     6,    21,    13,    14,    15,    16,    12,
  237.      6,     6,     6,    11,    11,     6,     6,     6,    68,     7,
  238.      6,     6,     9,     7,     7,     7,     7,     7,     6,     6,
  239.      9,     7,     7,     7,     7,     7,     7,     7,     0,     0,
  240.      4,    -1,    -1,     3,    11,    -1,    -1,    -1,    -1,    -1,
  241.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    26
  242. };
  243. #define YYPURE 1
  244.  
  245. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  246. #line 3 "bison.simple"
  247.  
  248. /* Skeleton output parser for bison,
  249.    Copyright (C) 1984 Bob Corbett and Richard Stallman
  250.  
  251.    This program is free software; you can redistribute it and/or modify
  252.    it under the terms of the GNU General Public License as published by
  253.    the Free Software Foundation; either version 1, or (at your option)
  254.    any later version.
  255.  
  256.    This program is distributed in the hope that it will be useful,
  257.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  258.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  259.    GNU General Public License for more details.
  260.  
  261.    You should have received a copy of the GNU General Public License
  262.    along with this program; if not, write to the Free Software
  263.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  264.  
  265.  
  266. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
  267. #include <alloca.h>
  268. #endif
  269.  
  270. /* This is the parser code that is written into each bison parser
  271.   when the %semantic_parser declaration is not specified in the grammar.
  272.   It was written by Richard Stallman by simplifying the hairy parser
  273.   used when %semantic_parser is specified.  */
  274.  
  275. /* Note: there must be only one dollar sign in this file.
  276.    It is replaced by the list of actions, each action
  277.    as one case of the switch.  */
  278.  
  279. #define yyerrok         (yyerrstatus = 0)
  280. #define yyclearin       (yychar = YYEMPTY)
  281. #define YYEMPTY         -2
  282. #define YYEOF           0
  283. #define YYFAIL          goto yyerrlab;
  284. #define YYACCEPT        return(0)
  285. #define YYABORT         return(1)
  286. #define YYERROR         goto yyerrlab
  287.  
  288. #define YYTERROR        1
  289.  
  290. #ifndef YYIMPURE
  291. #define YYLEX           yylex()
  292. #endif
  293.  
  294. #ifndef YYPURE
  295. #define YYLEX           yylex(&yylval, &yylloc)
  296. #endif
  297.  
  298. /* If nonreentrant, generate the variables here */
  299.  
  300. #ifndef YYIMPURE
  301.  
  302. int     yychar;                 /*  the lookahead symbol                */
  303. YYSTYPE yylval;                 /*  the semantic value of the           */
  304.                                 /*  lookahead symbol                    */
  305.  
  306. YYLTYPE yylloc;                 /*  location data for the lookahead     */
  307.                                 /*  symbol                              */
  308.  
  309. int yynerrs;                    /*  number of parse errors so far       */
  310. #endif  /* YYIMPURE */
  311.  
  312. #if YYDEBUG != 0
  313. int yydebug;                    /*  nonzero means print parse trace     */
  314. /* Since this is uninitialized, it does not stop multiple parsers
  315.    from coexisting.  */
  316. #endif
  317.  
  318. /*  YYMAXDEPTH indicates the initial size of the parser's stacks        */
  319.  
  320. #ifndef YYMAXDEPTH
  321. #define YYMAXDEPTH 200
  322. #endif
  323.  
  324. /*  YYMAXLIMIT is the maximum size the stacks can grow to
  325.     (effective only if the built-in stack extension method is used).  */
  326.  
  327. #ifndef YYMAXLIMIT
  328. #define YYMAXLIMIT 10000
  329. #endif
  330.  
  331.  
  332. #line 175 "bison.simple"
  333. int
  334. yyparse()
  335. {
  336.   register int yystate;
  337.   register int yyn;
  338.   register short *yyssp;
  339.   register YYSTYPE *yyvsp;
  340.   YYLTYPE *yylsp;
  341.   int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
  342.   int yychar1;          /*  lookahead token as an internal (translated) token number */
  343.  
  344.   short yyssa[YYMAXDEPTH];      /*  the state stack                     */
  345.   YYSTYPE yyvsa[YYMAXDEPTH];    /*  the semantic value stack            */
  346.   YYLTYPE yylsa[YYMAXDEPTH];    /*  the location stack                  */
  347.  
  348.   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
  349.   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
  350.   YYLTYPE *yyls = yylsa;
  351.  
  352.   int yymaxdepth = YYMAXDEPTH;
  353.  
  354. #ifndef YYPURE
  355.   int yychar;
  356.   YYSTYPE yylval;
  357.   YYLTYPE yylloc;
  358.   int yynerrs;
  359. #endif
  360.  
  361.   YYSTYPE yyval;                /*  the variable used to return         */
  362.                                 /*  semantic values from the action     */
  363.                                 /*  routines                            */
  364.  
  365.   int yylen;
  366.  
  367. #if YYDEBUG != 0
  368.   if (yydebug)
  369.     fprintf(stderr, "Starting parse\n");
  370. #endif
  371.  
  372.   yystate = 0;
  373.   yyerrstatus = 0;
  374.   yynerrs = 0;
  375.   yychar = YYEMPTY;             /* Cause a token to be read.  */
  376.  
  377.   /* Initialize stack pointers.
  378.      Waste one element of value and location stack
  379.      so that they stay on the same level as the state stack.  */
  380.  
  381.   yyssp = yyss - 1;
  382.   yyvsp = yyvs;
  383.   yylsp = yyls;
  384.  
  385. /* Push a new state, which is found in  yystate  .  */
  386. /* In all cases, when you get here, the value and location stacks
  387.    have just been pushed. so pushing a state here evens the stacks.  */
  388. yynewstate:
  389.  
  390.   *++yyssp = yystate;
  391.  
  392.   if (yyssp >= yyss + yymaxdepth - 1)
  393.     {
  394.       /* Give user a chance to reallocate the stack */
  395.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  396.       YYSTYPE *yyvs1 = yyvs;
  397.       YYLTYPE *yyls1 = yyls;
  398.       short *yyss1 = yyss;
  399.  
  400.       /* Get the current used size of the three stacks, in elements.  */
  401.       int size = yyssp - yyss + 1;
  402.  
  403. #ifdef yyoverflow
  404.       /* Each stack pointer address is followed by the size of
  405.          the data in use in that stack, in bytes.  */
  406.       yyoverflow("parser stack overflow",
  407.                  &yyss1, size * sizeof (*yyssp),
  408.                  &yyvs1, size * sizeof (*yyvsp),
  409.                  &yyls1, size * sizeof (*yylsp),
  410.                  &yymaxdepth);
  411.  
  412.       yyss = yyss1; yyvs = yyvs1; yyls = yyls1;
  413. #else /* no yyoverflow */
  414.       /* Extend the stack our own way.  */
  415.       if (yymaxdepth >= YYMAXLIMIT)
  416.         yyerror("parser stack overflow");
  417.       yymaxdepth *= 2;
  418.       if (yymaxdepth > YYMAXLIMIT)
  419.         yymaxdepth = YYMAXLIMIT;
  420.       yyss = (short *) alloca (yymaxdepth * sizeof (*yyssp));
  421.       bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  422.       yyvs = (YYSTYPE *) alloca (yymaxdepth * sizeof (*yyvsp));
  423.       bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  424. #ifdef YYLSP_NEEDED
  425.       yyls = (YYLTYPE *) alloca (yymaxdepth * sizeof (*yylsp));
  426.       bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  427. #endif
  428. #endif /* no yyoverflow */
  429.  
  430.       yyssp = yyss + size - 1;
  431.       yyvsp = yyvs + size - 1;
  432. #ifdef YYLSP_NEEDED
  433.       yylsp = yyls + size - 1;
  434. #endif
  435.  
  436. #if YYDEBUG != 0
  437.       if (yydebug)
  438.         fprintf(stderr, "Stack size increased to %d\n", yymaxdepth);
  439. #endif
  440.  
  441.       if (yyssp >= yyss + yymaxdepth - 1)
  442.         YYABORT;
  443.     }
  444.  
  445. #if YYDEBUG != 0
  446.   if (yydebug)
  447.     fprintf(stderr, "Entering state %d\n", yystate);
  448. #endif
  449.  
  450. /* Do appropriate processing given the current state.  */
  451. /* Read a lookahead token if we need one and don't already have one.  */
  452. yyresume:
  453.  
  454.   /* First try to decide what to do without reference to lookahead token.  */
  455.  
  456.   yyn = yypact[yystate];
  457.   if (yyn == YYFLAG)
  458.     goto yydefault;
  459.  
  460.   /* Not known => get a lookahead token if don't already have one.  */
  461.  
  462.   /* yychar is either YYEMPTY or YYEOF
  463.      or a valid token in external form.  */
  464.  
  465.   if (yychar == YYEMPTY)
  466.     {
  467. #if YYDEBUG != 0
  468.       if (yydebug)
  469.         fprintf(stderr, "Reading a token: ");
  470. #endif
  471.       yychar = YYLEX;
  472.     }
  473.  
  474.   /* Convert token to internal form (in yychar1) for indexing tables with */
  475.  
  476.   if (yychar <= 0)              /* This means end of input. */
  477.     {
  478.       yychar1 = 0;
  479.       yychar = YYEOF;           /* Don't call YYLEX any more */
  480.  
  481. #if YYDEBUG != 0
  482.       if (yydebug)
  483.         fprintf(stderr, "Now at end of input.\n");
  484. #endif
  485.     }
  486.   else
  487.     {
  488.       yychar1 = YYTRANSLATE(yychar);
  489.  
  490. #if YYDEBUG != 0
  491.       if (yydebug)
  492.         fprintf(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
  493. #endif
  494.     }
  495.  
  496.   yyn += yychar1;
  497.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  498.     goto yydefault;
  499.  
  500.   yyn = yytable[yyn];
  501.  
  502.   /* yyn is what to do for this token type in this state.
  503.      Negative => reduce, -yyn is rule number.
  504.      Positive => shift, yyn is new state.
  505.        New state is final state => don't bother to shift,
  506.        just return success.
  507.      0, or most negative number => error.  */
  508.  
  509.   if (yyn < 0)
  510.     {
  511.       if (yyn == YYFLAG)
  512.         goto yyerrlab;
  513.       yyn = -yyn;
  514.       goto yyreduce;
  515.     }
  516.   else if (yyn == 0)
  517.     goto yyerrlab;
  518.  
  519.   if (yyn == YYFINAL)
  520.     YYACCEPT;
  521.  
  522.   /* Shift the lookahead token.  */
  523.  
  524. #if YYDEBUG != 0
  525.   if (yydebug)
  526.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  527. #endif
  528.  
  529.   /* Discard the token being shifted unless it is eof.  */
  530.   if (yychar != YYEOF)
  531.     yychar = YYEMPTY;
  532.  
  533.   *++yyvsp = yylval;
  534. #ifdef YYLSP_NEEDED
  535.   *++yylsp = yylloc;
  536. #endif
  537.  
  538.   /* count tokens shifted since error; after three, turn off error status.  */
  539.   if (yyerrstatus) yyerrstatus--;
  540.  
  541.   yystate = yyn;
  542.   goto yynewstate;
  543.  
  544. /* Do the default action for the current state.  */
  545. yydefault:
  546.  
  547.   yyn = yydefact[yystate];
  548.   if (yyn == 0)
  549.     goto yyerrlab;
  550.  
  551. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  552. yyreduce:
  553.   yylen = yyr2[yyn];
  554.   yyval = yyvsp[1-yylen]; /* implement default value of the action */
  555.  
  556. #if YYDEBUG != 0
  557.   if (yydebug)
  558.     {
  559.       if (yylen == 1)
  560.         fprintf (stderr, "Reducing 1 value via line %d, ",
  561.                  yyrline[yyn]);
  562.       else
  563.         fprintf (stderr, "Reducing %d values via line %d, ",
  564.                  yylen, yyrline[yyn]);
  565.     }
  566. #endif
  567.  
  568.  
  569.   switch (yyn) {
  570.  
  571. case 4:
  572. #line 107 "synan.y"
  573. {
  574.               /* Temporary */
  575.  
  576.               in_int++;
  577.  
  578.               prog.dimensions = in_int;
  579.               prog.quant = (int *) malloc((unsigned)sizeof(int) * in_int);
  580.               MEMCHECK(prog.quant);
  581.  
  582.               prog.quant_step =
  583.               (float *)malloc((unsigned)sizeof(float) * in_int);
  584.               MEMCHECK(prog.quant_step);
  585.  
  586.               prog.train_table =
  587.               (float **)malloc((unsigned)sizeof(float *) * in_int);
  588.               MEMCHECK(prog.train_table);
  589.  
  590.               prog.test_table =
  591.               (float **)malloc((unsigned)sizeof(float *) * in_int);
  592.               MEMCHECK(prog.test_table);
  593.  
  594.               prog.test_table_quant =
  595.               (int **)malloc((unsigned) sizeof(int *) * in_int);
  596.               MEMCHECK(prog.test_table_quant);
  597.  
  598.               prog.largest =
  599.               (float *)malloc((unsigned)sizeof(float) * in_int);
  600.               MEMCHECK(prog.largest);
  601.  
  602.               prog.smallest =
  603.               (float *)malloc((unsigned)sizeof(float) * in_int);
  604.               MEMCHECK(prog.smallest);
  605.  
  606.               prog.string_width =
  607.               (int *)malloc((unsigned)sizeof(int) * in_int);
  608.               MEMCHECK(prog.string_width);
  609.  
  610.               prog.walk_step = (int *)malloc((unsigned)sizeof(int) * in_int);
  611.               MEMCHECK(prog.walk_step);
  612.  
  613.               prog.random_walk =
  614.               (bit_vec **)malloc((unsigned)sizeof(bit_vec *) * in_int);
  615.               MEMCHECK(prog.random_walk);
  616.  
  617.               tmp_table = (float **)malloc((unsigned)sizeof(float *) * in_int);
  618.               MEMCHECK(tmp_table);
  619.           ;
  620.     break;}
  621. case 15:
  622. #line 169 "synan.y"
  623. {
  624.                  tuple_ptr = 0;
  625.              ;
  626.     break;}
  627. case 16:
  628. #line 173 "synan.y"
  629. {
  630.                  if (tuple_ptr > prog.dimensions)
  631.                  {
  632.                      prog.error = TRUE;
  633.                      Printf("Semantics error : too many elements in quantization list on line %d\n", line_no);
  634.  
  635.                  }
  636.                  if (tuple_ptr < prog.dimensions)
  637.                  {
  638.                      prog.error = TRUE;
  639.                      Printf("Semantics error : not enough elements in quantization list on line %d\n", line_no);
  640.  
  641.                  }
  642.              ;
  643.     break;}
  644. case 17:
  645. #line 188 "synan.y"
  646. {
  647.                  prog.quant[tuple_ptr] = in_int;
  648.                  tuple_ptr++;
  649.              ;
  650.     break;}
  651. case 18:
  652. #line 193 "synan.y"
  653. {
  654.                  prog.quant[tuple_ptr] = in_int;
  655.                  tuple_ptr++;
  656.              ;
  657.     break;}
  658. case 19:
  659. #line 200 "synan.y"
  660. {
  661.            tuple_ptr = 0;
  662.        ;
  663.     break;}
  664. case 20:
  665. #line 204 "synan.y"
  666. {
  667.            if (tuple_ptr > prog.dimensions)
  668.            {
  669.                prog.error = TRUE;
  670.                Printf("Semantics error : too many elements in coding list on line %d\n", line_no);
  671.  
  672.            }
  673.            if (tuple_ptr < prog.dimensions)
  674.            {
  675.                prog.error = TRUE;
  676.                Printf("Semantics error : not enough elements in coding list on line %d\n", line_no);
  677.  
  678.            }
  679.        ;
  680.     break;}
  681. case 21:
  682. #line 219 "synan.y"
  683. {
  684.               prog.string_width[tuple_ptr] = in_int;
  685.           ;
  686.     break;}
  687. case 22:
  688. #line 223 "synan.y"
  689. {
  690.               prog.walk_step[tuple_ptr] = in_int;
  691.               tuple_ptr++;
  692.           ;
  693.     break;}
  694. case 23:
  695. #line 228 "synan.y"
  696. {
  697.               prog.string_width[tuple_ptr] = in_int;
  698.           ;
  699.     break;}
  700. case 24:
  701. #line 232 "synan.y"
  702. {
  703.               prog.walk_step[tuple_ptr] = in_int;
  704.               tuple_ptr++;
  705.           ;
  706.     break;}
  707. case 25:
  708. #line 238 "synan.y"
  709. {
  710.                 prog.trainset_sz = in_int;
  711.                 train_size_flag = TRUE;
  712.             ;
  713.     break;}
  714. case 26:
  715. #line 245 "synan.y"
  716. {
  717.                 if (!train_size_flag)
  718.                 {
  719.                     Printf("Semantics error : training set defined before size\n",0);
  720.  
  721.                     return(-1);
  722.                 }
  723.                 else
  724.                 {
  725.                     int i;
  726.  
  727.                     tmp_max_sz = prog.trainset_sz;
  728.                     tuple_ptr = 0;
  729.                     table_ptr = 0;
  730.                     for (i = 0; i < prog.dimensions; i++)
  731.                     {
  732.                         tmp_table[i] = (float *)malloc((unsigned)sizeof(float)*prog.trainset_sz);
  733.                         MEMCHECK(tmp_table[i]);
  734.                     }
  735.                 }
  736.             ;
  737.     break;}
  738. case 27:
  739. #line 266 "synan.y"
  740. {
  741.                 int i;
  742.  
  743.                 if (tuple_ptr < prog.trainset_sz)
  744.                 {
  745.                     prog.error = TRUE;
  746.                     Printf("Semantics error : not enough elements in training set\n",0);
  747.  
  748.                 }
  749.                 for (i = 0; i < prog.dimensions; i++)
  750.                 {
  751.                     prog.train_table[i] = tmp_table[i];
  752.                 }
  753.             ;
  754.     break;}
  755. case 28:
  756. #line 281 "synan.y"
  757. {
  758.                 prog.testset_sz = in_int;
  759.                 test_size_flag = TRUE;
  760.             ;
  761.     break;}
  762. case 29:
  763. #line 288 "synan.y"
  764. {
  765.                 if (!test_size_flag)
  766.                 {
  767.                     Printf("Semantics error : test set defined before size\n",0);
  768.  
  769.                     return(-1);
  770.                 }
  771.                 else
  772.                 {
  773.                     int i;
  774.  
  775.                     tmp_max_sz = prog.testset_sz;
  776.                     tuple_ptr = 0;
  777.                     table_ptr = 0;
  778.                     for (i = 0; i < prog.dimensions; i++)
  779.                     {
  780.                         tmp_table[i] = 
  781.                         (float *)malloc((unsigned)sizeof(float) * prog.testset_sz);
  782.                         MEMCHECK(tmp_table[i]);
  783.                         prog.test_table_quant[i] = 
  784.                         (int *)malloc((unsigned) sizeof(int) * prog.testset_sz);
  785.                         MEMCHECK(prog.test_table_quant[i]);
  786.                     }
  787.                 }
  788.             ;
  789.     break;}
  790. case 30:
  791. #line 313 "synan.y"
  792. {
  793.                 int i;
  794.  
  795.                 if (tuple_ptr < prog.testset_sz)
  796.                 {
  797.                     prog.error = TRUE;
  798.                     Printf("Semantics error : not enough elements in test set\n",0);
  799.  
  800.                 }
  801.                 for (i = 0; i < prog.dimensions; i++)
  802.                 {
  803.                     prog.test_table[i] = tmp_table[i];
  804.                 }
  805.             ;
  806.     break;}
  807. case 31:
  808. #line 329 "synan.y"
  809. {
  810.           tmp_table[table_ptr][tuple_ptr] = in_real;
  811.           table_ptr++;
  812.           if (table_ptr == prog.dimensions)
  813.           {
  814.               table_ptr = 0;
  815.               tuple_ptr++;
  816.           }
  817.           if (tuple_ptr > tmp_max_sz)
  818.           {
  819.               Printf("Semantics error: too many elements in table\n",0);
  820.  
  821.               return(-1);
  822.           }
  823.       ;
  824.     break;}
  825. case 32:
  826. #line 344 "synan.y"
  827. {
  828.           tmp_table[table_ptr][tuple_ptr] = in_real;
  829.           table_ptr++;
  830.           if (table_ptr == prog.dimensions)
  831.           {
  832.               table_ptr = 0;
  833.               tuple_ptr++;
  834.           }
  835.           if (tuple_ptr > tmp_max_sz)
  836.           {
  837.               Printf("Semantics error: too many elements in table\n",0);
  838.  
  839.               return(-1);
  840.           }
  841.       ;
  842.     break;}
  843. case 34:
  844. #line 362 "synan.y"
  845. {
  846.         in_real = (float) in_int;
  847.     ;
  848.     break;}
  849. case 35:
  850. #line 368 "synan.y"
  851. {
  852.                  tuple_ptr = 0;
  853.                  largest_flag = TRUE;
  854.              ;
  855.     break;}
  856. case 36:
  857. #line 373 "synan.y"
  858. {
  859.                  if (tuple_ptr > prog.dimensions)
  860.                  {
  861.                      prog.error = TRUE;
  862.                      Printf("Semantics error : too many elements in largest list on line %d\n", line_no);
  863.  
  864.                  }
  865.                  if (tuple_ptr < prog.dimensions)
  866.                  {
  867.                      prog.error = TRUE;
  868.                      Printf("Semantics error : not enough elements in largest list on line %d\n", line_no);
  869.  
  870.                  }
  871.              ;
  872.     break;}
  873. case 37:
  874. #line 388 "synan.y"
  875. {
  876.                  prog.largest[tuple_ptr] = in_real;
  877.                  tuple_ptr++;
  878.              ;
  879.     break;}
  880. case 38:
  881. #line 393 "synan.y"
  882. {
  883.                  prog.largest[tuple_ptr] = in_real;
  884.                  tuple_ptr++;
  885.              ;
  886.     break;}
  887. case 39:
  888. #line 400 "synan.y"
  889. {
  890.                  tuple_ptr = 0;
  891.                  smallest_flag = TRUE;
  892.              ;
  893.     break;}
  894. case 40:
  895. #line 405 "synan.y"
  896. {
  897.                  if (tuple_ptr > prog.dimensions)
  898.                  {
  899.                      prog.error = TRUE;
  900.                      Printf("Semantics error : too many elements in smallest list on line %d\n", line_no);
  901.  
  902.                  }
  903.                  if (tuple_ptr < prog.dimensions)
  904.                  {
  905.                      prog.error = TRUE;
  906.                      Printf("Semantics error : not enough elements in smallest list on line %d\n", line_no);
  907.  
  908.                  }
  909.              ;
  910.     break;}
  911. case 41:
  912. #line 420 "synan.y"
  913. {
  914.                  prog.smallest[tuple_ptr] = in_real;
  915.                  tuple_ptr++;
  916.              ;
  917.     break;}
  918. case 42:
  919. #line 425 "synan.y"
  920. {
  921.                  prog.smallest[tuple_ptr] = in_real;
  922.                  tuple_ptr++;
  923.              ;
  924.     break;}
  925. case 50:
  926. #line 442 "synan.y"
  927. {
  928.               prog.tree_sz = in_int;
  929.           ;
  930.     break;}
  931. case 51:
  932. #line 448 "synan.y"
  933. {
  934.                 prog.max_correct = in_int;
  935.             ;
  936.     break;}
  937. case 52:
  938. #line 454 "synan.y"
  939. {
  940.                prog.max_epochs = in_int;
  941.            ;
  942.     break;}
  943. case 53:
  944. #line 460 "synan.y"
  945. {
  946.             if (in_int % 2 != 1)
  947.             {
  948.                 Printf("Semantics error : vote number is even\n",0);
  949.                 return(-1);
  950.             }
  951.             prog.vote = in_int;
  952.         ;
  953.     break;}
  954. }
  955.    /* the action file gets copied in in place of this dollarsign */
  956. #line 412 "bison.simple"
  957.  
  958.   yyvsp -= yylen;
  959.   yyssp -= yylen;
  960. #ifdef YYLSP_NEEDED
  961.   yylsp -= yylen;
  962. #endif
  963.  
  964. #if YYDEBUG != 0
  965.   if (yydebug)
  966.     {
  967.       short *ssp1 = yyss - 1;
  968.       fprintf (stderr, "state stack now");
  969.       while (ssp1 != yyssp)
  970.         fprintf (stderr, " %d", *++ssp1);
  971.       fprintf (stderr, "\n");
  972.     }
  973. #endif
  974.  
  975.   *++yyvsp = yyval;
  976.  
  977. #ifdef YYLSP_NEEDED
  978.   yylsp++;
  979.   if (yylen == 0)
  980.     {
  981.       yylsp->first_line = yylloc.first_line;
  982.       yylsp->first_column = yylloc.first_column;
  983.       yylsp->last_line = (yylsp-1)->last_line;
  984.       yylsp->last_column = (yylsp-1)->last_column;
  985.       yylsp->text = 0;
  986.     }
  987.   else
  988.     {
  989.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  990.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  991.     }
  992. #endif
  993.  
  994.   /* Now "shift" the result of the reduction.
  995.      Determine what state that goes to,
  996.      based on the state we popped back to
  997.      and the rule number reduced by.  */
  998.  
  999.   yyn = yyr1[yyn];
  1000.  
  1001.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1002.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1003.     yystate = yytable[yystate];
  1004.   else
  1005.     yystate = yydefgoto[yyn - YYNTBASE];
  1006.  
  1007.   goto yynewstate;
  1008.  
  1009. yyerrlab:   /* here on detecting error */
  1010.  
  1011.   if (! yyerrstatus)
  1012.     /* If not already recovering from an error, report this error.  */
  1013.     {
  1014.       ++yynerrs;
  1015.       yyerror("parse error");
  1016.     }
  1017.  
  1018.   if (yyerrstatus == 3)
  1019.     {
  1020.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1021.  
  1022.       /* return failure if at end of input */
  1023.       if (yychar == YYEOF)
  1024.         YYABORT;
  1025.  
  1026. #if YYDEBUG != 0
  1027.       if (yydebug)
  1028.         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1029. #endif
  1030.  
  1031.       yychar = YYEMPTY;
  1032.     }
  1033.  
  1034.   /* Else will try to reuse lookahead token
  1035.      after shifting the error token.  */
  1036.  
  1037.   yyerrstatus = 3;              /* Each real token shifted decrements this */
  1038.  
  1039.   goto yyerrhandle;
  1040.  
  1041. yyerrdefault:  /* current state does not do anything special for the error token. */
  1042.  
  1043. #if 0
  1044.   /* This is wrong; only states that explicitly want error tokens
  1045.      should shift them.  */
  1046.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1047.   if (yyn) goto yydefault;
  1048. #endif
  1049.  
  1050. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1051.  
  1052.   if (yyssp == yyss) YYABORT;
  1053.   yyvsp--;
  1054.   yystate = *--yyssp;
  1055. #ifdef YYLSP_NEEDED
  1056.   yylsp--;
  1057. #endif
  1058.  
  1059. #if YYDEBUG != 0
  1060.   if (yydebug)
  1061.     {
  1062.       short *ssp1 = yyss - 1;
  1063.       fprintf (stderr, "Error: state stack now");
  1064.       while (ssp1 != yyssp)
  1065.         fprintf (stderr, " %d", *++ssp1);
  1066.       fprintf (stderr, "\n");
  1067.     }
  1068. #endif
  1069.  
  1070. yyerrhandle:
  1071.  
  1072.   yyn = yypact[yystate];
  1073.   if (yyn == YYFLAG)
  1074.     goto yyerrdefault;
  1075.  
  1076.   yyn += YYTERROR;
  1077.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1078.     goto yyerrdefault;
  1079.  
  1080.   yyn = yytable[yyn];
  1081.   if (yyn < 0)
  1082.     {
  1083.       if (yyn == YYFLAG)
  1084.         goto yyerrpop;
  1085.       yyn = -yyn;
  1086.       goto yyreduce;
  1087.     }
  1088.   else if (yyn == 0)
  1089.     goto yyerrpop;
  1090.  
  1091.   if (yyn == YYFINAL)
  1092.     YYACCEPT;
  1093.  
  1094. #if YYDEBUG != 0
  1095.   if (yydebug)
  1096.     fprintf(stderr, "Shifting error token, ");
  1097. #endif
  1098.  
  1099.   *++yyvsp = yylval;
  1100. #ifdef YYLSP_NEEDED
  1101.   *++yylsp = yylloc;
  1102. #endif
  1103.  
  1104.   yystate = yyn;
  1105.   goto yynewstate;
  1106. }
  1107. #line 469 "synan.y"
  1108.  
  1109.  
  1110.  
  1111. /* Lexical states */
  1112.  
  1113. #define LEX_START 0
  1114. #define LEX_INT 1
  1115. #define LEX_DEC 2
  1116. #define LEX_IDENT 3
  1117. #define LEX_PUNCT 4
  1118. #define LEX_COMMENT 5
  1119. #define LEX_STOP 1000
  1120.  
  1121. #define MAX_LEN_BUF 1000
  1122.  
  1123. int lexstate;
  1124. int nextchar;
  1125. FILE *yyin;
  1126.  
  1127. #define ISCOMMENT(c) (c == '#')
  1128.  
  1129. void
  1130. lexinit()
  1131.  
  1132. {
  1133.     lexstate = LEX_START;
  1134.     nextchar = getc(yyin);
  1135. }
  1136.  
  1137. isextdigit(c)
  1138.  
  1139. char c;
  1140.  
  1141.     return((c == 'e') || (c == 'E') || (c == '+') || (c == '-') || isdigit(c));
  1142. }
  1143.  
  1144. iswhite(c)
  1145.  
  1146. char c;
  1147.  
  1148. {
  1149.     if (c == '\n')
  1150.     {
  1151.         line_no++;
  1152.         return(TRUE);
  1153.     }
  1154.     else
  1155.     {
  1156.         return((c == 0) || (c == ' ') || (c == '\t'));
  1157.     }
  1158. }
  1159.  
  1160. gettoken(str)
  1161.  
  1162. char *str;
  1163.  
  1164. {
  1165.  
  1166.     int i;
  1167.     int outcode;
  1168.  
  1169.     static struct tok
  1170.     {
  1171.         char *token;
  1172.         int code;
  1173.     } toktab[] =
  1174.     {
  1175.         "function"    , FUNCTION,
  1176.         "dimension"   , DIMENSIONS,
  1177.         "dimensions"  , DIMENSIONS,
  1178.         "="           , EQUALS,
  1179.         "quantization", QUANTIZATION,
  1180.         ":"           , COLON,
  1181.         "coding"      , CODING,
  1182.         "training"    , TRAINING,
  1183.         "set"         , SET,
  1184.         "size"        , SIZE,
  1185.         "test"        , TEST,
  1186.         "tree"        , TREE,
  1187.         "minimum"     , MIN,
  1188.         "min"         , MIN,
  1189.         "maximum"     , MAX,
  1190.         "max"         , MAX,
  1191.         "correct"     , CORRECT,
  1192.         "epochs"      , EPOCHS,
  1193.         "largest"     , LARGEST,
  1194.         "smallest"    , SMALLEST,
  1195.         "domain"      , DOMAIN,
  1196.         "vote"        , VOTE,
  1197.         NULL          ,0
  1198.     };
  1199.  
  1200.     outcode = IDENTIFIER;
  1201.  
  1202.     for (i = 0; toktab[i].token != NULL; i++)
  1203.     {
  1204.         if (strcmp(str,toktab[i].token) == 0)
  1205.         {
  1206.             outcode = toktab[i].code;
  1207.             break;
  1208.         }
  1209.     }
  1210.  
  1211.     return(outcode);
  1212. }
  1213.  
  1214. int
  1215. yylex()
  1216.  
  1217. {
  1218.     char yytext[MAX_LEN_BUF];
  1219.     int bufptr;
  1220.     bool found_token;
  1221.     int token;
  1222.  
  1223.     found_token = FALSE;
  1224.     bufptr = 0;
  1225.  
  1226.     while (!found_token)
  1227.     {
  1228.         switch (lexstate)
  1229.         {
  1230.             case LEX_START:
  1231.                 while (iswhite(nextchar))
  1232.                 {
  1233.                      nextchar = getc(yyin);
  1234.                 }
  1235.  
  1236.                 if (ISCOMMENT(nextchar))
  1237.                 {
  1238.                     nextchar = getc(yyin);
  1239.                     lexstate = LEX_COMMENT;
  1240.                 }
  1241.                 else if (isdigit(nextchar) || (nextchar == '-'))
  1242.                 {
  1243.                     yytext[bufptr++] = nextchar;
  1244.                     nextchar = getc(yyin);
  1245.                     lexstate = LEX_INT;
  1246.                 }
  1247.                 else if (isalpha(nextchar))
  1248.                 {
  1249.                     yytext[bufptr++] = nextchar;
  1250.                     nextchar = getc(yyin);
  1251.                     lexstate = LEX_IDENT;
  1252.                 }
  1253.                 else if (ispunct(nextchar))
  1254.                 {
  1255.                     yytext[bufptr++] = nextchar;
  1256.                     nextchar = getc(yyin);
  1257.                     lexstate = LEX_PUNCT;
  1258.                 }
  1259.                 else if (nextchar == EOF)
  1260.                 {
  1261.                     lexstate = LEX_STOP;
  1262.                 }
  1263.                 else
  1264.                 {
  1265.                     Printf("Lexical error: unrecognized character %d\n",(int) nextchar);
  1266.  
  1267.                     exit(0);
  1268.                 }
  1269.                 break;
  1270.  
  1271.             case LEX_INT:
  1272.                 while (isdigit(nextchar))
  1273.                 {
  1274.                     yytext[bufptr++] = nextchar;
  1275.                     nextchar = getc(yyin);
  1276.                 }
  1277.                 if (nextchar == '.')
  1278.                 {
  1279.                     yytext[bufptr++] = nextchar;
  1280.                     nextchar = getc(yyin);
  1281.                     lexstate = LEX_DEC;
  1282.                 }
  1283.                 else
  1284.                 {
  1285.                     yytext[bufptr] = 0;
  1286.                     in_int = atoi(yytext);
  1287.                     token = INTEGER;
  1288.                     found_token = TRUE;
  1289.                 }
  1290.                 break;
  1291.  
  1292.             case LEX_DEC:
  1293.                 while (isextdigit(nextchar))
  1294.                 {
  1295.                     yytext[bufptr++] = nextchar;
  1296.                     nextchar = getc(yyin);
  1297.                 }
  1298.                 yytext[bufptr] = 0;
  1299.                 sscanf(yytext,"%g",&in_real);
  1300.                 token = REAL;
  1301.                 found_token = TRUE;
  1302.                 break;
  1303.  
  1304.             case LEX_IDENT:
  1305.                 while (isalpha(nextchar) || isdigit(nextchar))
  1306.                 {
  1307.                     yytext[bufptr++] = nextchar;
  1308.                     nextchar = getc(yyin);
  1309.                 }
  1310.                 yytext[bufptr] = 0;
  1311.                 token = gettoken(yytext);
  1312.                 found_token = TRUE;
  1313.                 break;
  1314.  
  1315.             case LEX_PUNCT:
  1316.                 yytext[bufptr] = 0;
  1317.                 token = gettoken(yytext);
  1318.                 found_token = TRUE;
  1319.                 break;
  1320.  
  1321.             case LEX_COMMENT:
  1322.                 while (nextchar != '\n')
  1323.                 {
  1324.                     nextchar = getc(yyin);
  1325.                 }
  1326.                 lexstate = LEX_START;
  1327.                 break;
  1328.  
  1329.             case LEX_STOP:
  1330.                 token = 0;
  1331.                 found_token = TRUE;
  1332.                 break;
  1333.         }
  1334.     }
  1335.  
  1336.     if (lexstate != LEX_STOP)
  1337.     {
  1338.         lexstate = LEX_START;
  1339.     }
  1340.     return(token);
  1341. }
  1342.  
  1343. yyerror(s)
  1344. char *s;
  1345. {
  1346.     Printf("Error found on line %d\n",line_no);
  1347.     prog.error = TRUE;
  1348. }
  1349.